/*
 * @Author: LiJia
 * @Date: 2021-03-29 02:27:50
 * @LastEditTime: 2021-03-29 05:03:04
 * @LastEditors: LiJia
 * @Description: Description
 * @FilePath: \class-manage-system\miniprogram\pages\mine\children\teacher-source\teacher-source.ts
 */
Page({

  // 页面的初始数据
  data: {
    sourceTable: [],
    hasMoreSourceInfo: false
  },

  // 生命周期函数--监听页面加载
  onLoad() {
    this.getSourceTable()
    const eventChannel = this.getOpenerEventChannel()
    eventChannel.on('yourData', (req) => {
      console.log(req)
    })
  },

  // 生命周期函数--监听页面初次渲染完成
  onReady() {},

  // 生命周期函数--监听页面显示
  onShow() {},

  // 生命周期函数--监听页面隐藏
  onHide() {},

  // 生命周期函数--监听页面卸载
  onUnload() {},

  // 页面相关事件处理函数--监听用户下拉动作
  onPullDownRefresh() {},

  // 页面上拉触底事件的处理函数
  onReachBottom() {},

  // 用户点击右上角分享
  onShareAppMessage() {
    return {};
  },

  // ==================== 用户自定义方法 start =================== //
  getSourceTable() {
    console.log('获取资源列表')
    let res = [
      {
        id: 0,
        title: '高等数学复习资料',
        uploadDate: "2017-03-26",
        type: 'pdf'
      },
      {
        id: 1,
        title: '英语听说读写资料',
        uploadDate: "2017-03-27",
        type: 'mp3'
      },
      {
        id: 2,
        title: 'Java框架入门',
        uploadDate: "2017-03-27",
        type: 'mp4'
      }
    ]
    this.setData({
      sourceTable: res as never
    })
  }
  // ==================== 用户自定义方法  end  =================== //
})
